Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK] Options to custonize ViewAssets's tabs #5126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Oct 22, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on enhancing the ConnectButton component by allowing customization of the asset tab display order in the "View Assets" section. Users can now specify whether to show the "Tokens" or "NFTs" tab first, and an empty array will hide the "View Funds" button.

Detailed summary

  • Added assetTabs prop to ConnectButton for customizing asset tab order.
  • Updated ViewAssets to dynamically render tabs based on assetTabs prop.
  • Modified DetailsModal to conditionally display "View Funds" button based on assetTabs length.
  • Enhanced documentation with instructions for using the new feature.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 8:01pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 8:01pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 8:01pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 8:01pm

Copy link

changeset-bot bot commented Oct 22, 2024

🦋 Changeset detected

Latest commit: 8b87882

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
thirdweb Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

graphite-app bot commented Oct 22, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @kien-ngo and the rest of your teammates on Graphite Graphite

Copy link
Contributor

github-actions bot commented Oct 22, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 861 ms (0%) 3 s (-19.42% 🔽) 3.9 s
thirdweb (cjs) 102.91 KB (0%) 2.1 s (0%) 7.3 s (+7.32% 🔺) 9.3 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 359 ms (-10.77% 🔽) 456 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 193 ms (+34.3% 🔺) 203 ms
thirdweb/react (minimal + tree-shaking) 17.38 KB (0%) 348 ms (0%) 569 ms (-40.08% 🔽) 917 ms

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 28.84615% with 37 lines in your changes missing coverage. Please review.

Project coverage is 45.30%. Comparing base (519349b) to head (8b87882).

Files with missing lines Patch % Lines
.../react/web/ui/ConnectWallet/screens/ViewAssets.tsx 44.11% 19 Missing ⚠️
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 0.00% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5126      +/-   ##
==========================================
+ Coverage   45.29%   45.30%   +0.01%     
==========================================
  Files        1067     1067              
  Lines       55341    55358      +17     
  Branches     3973     3974       +1     
==========================================
+ Hits        25068    25082      +14     
- Misses      29581    29584       +3     
  Partials      692      692              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 519349b
packages 40.32% <28.84%> (+0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...b/src/react/web/ui/ConnectWallet/ConnectButton.tsx 49.00% <ø> (ø)
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 1.09% <0.00%> (-0.01%) ⬇️
.../react/web/ui/ConnectWallet/screens/ViewAssets.tsx 19.75% <44.11%> (+16.81%) ⬆️

Copy link
Member

@gregfromstl gregfromstl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should make this change. It's incredibly niche and if they want this level of customization they should probably be building their own UI. It'll also break as soon as we add another tab to this screen.

Copy link
Contributor Author

We were having a discussion here: https://linear.app/thirdweb/issue/CNCT-2036/feedbackfeature-request-on-nfts-tab
Joaquim thought it would be a good idea to add this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages Playground Changes involving the Playground codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants